trigger AccountNumberRequired on Account (after insert) {
	List<Account> accList=Trigger.new;
	List<Opportunity> newListOpptys=new List<Opportunity>();
	for(Account a:accList)
	{
		Opportunity defalutopp=new Opportunity();
			defalutopp.Name=a.Name+' oppty';
			defalutopp.StageName='Prospecting12131';
			defalutopp.CloseDate=System.today();
			defalutopp.AccountId=a.Id;
		newListOpptys.add(defalutopp);
		System.debug('created opp id-->'+defalutopp.Id);

	}
insert newListOpptys;

// Create a new single email message object
// that will send out a single email to the addresses in the To, CC & BCC list.
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
// Strings to hold the email addresses to which you are sending the email.
String[] toAddresses = new String[] {'srirangam.narasimharao@gmail.com'};

// Assign the addresses for the To and CC lists to the mail object.
mail.setToAddresses(toAddresses);





mail.setSubject('New Case Created : ' + newListOpptys[0].Id);
// Set to True if you want to BCC yourself on the email.

// Optionally append the salesforce.com email signature to the email.
// The email address of the user executing the Apex Code will be used.

// Specify the text content of the email.
mail.setPlainTextBody('Your Case: ' + newListOpptys[0].Id +' has been created');
mail.setHtmlBody('Your case:<b> ' + newListOpptys[0].Id +' </b>has been created<p>'+
' View case <a href=https://na1.salesforce.com/'+newListOpptys[0].Id+'>click here</a>');
// Send the email you have created.
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
}